//
//  BBHelpCell.swift
//  BBLinkiOSProject
//
//  Created by liuzhu on 2018/12/18.
//  Copyright © 2018 liuzhu. All rights reserved.
//

import UIKit

class BBHelpCell: UITableViewCell {

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        //必须加入的方法
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI(){
        contentView.addSubview(leftImage)
        contentView.addSubview(titleLabel)
        contentView.addSubview(contentLabel)
        leftImage.xmg_AlignInner(type: XMG_AlignType.TopLeft, referView: contentView, size: CGSize(width: 30, height: 30), offset: CGPoint(x: 5, y: 5))
        titleLabel.xmg_AlignVertical(type: XMG_AlignType.CenterRight, referView: leftImage, size: nil, offset: CGPoint(x: 10, y:-1))
        contentLabel.xmg_AlignVertical(type: XMG_AlignType.BottomLeft, referView: titleLabel, size: nil, offset: CGPoint(x: 0, y: 5))
        contentLabel.xmg_AlignInner(type: XMG_AlignType.BottomRight, referView: contentView, size: nil, offset: CGPoint(x: 0, y: 0))
    }
    
    private lazy var leftImage:UIImageView = {
        let iv = UIImageView()
        iv.image = UIImage(named: "help_Question")
        
        return iv
    }()
    
    public lazy var titleLabel:UILabel = {
        let la = UILabel()
        //la.text = "This is a Question?"
        la.font = UIFont.systemFont(ofSize: 18)
        return la
    }()
    
    public lazy var contentLabel:UILabel = {
        let la = UILabel()
        la.textColor = UIColor.lightGray
        la.numberOfLines = 0
        la.font = UIFont.systemFont(ofSize: 13)
        la.preferredMaxLayoutWidth = UIScreen.main.bounds.width - 80
        //la.text = "This is a answer is is a answes,This is a answer,This is a answer,This is a answer is is a answer,This is a Answer."
        return la
    }()
}
